use elasticsearch::{Elasticsearch, Error};
use elasticsearch::http::transport::Transport;
use crate::config;

pub async fn client() -> Result<Elasticsearch, Error> {
    let url = config::get_node().await;
    let transport = Transport::single_node(url.as_str())?;
    Ok(Elasticsearch::new(transport))
}
